<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Qwt User&#39;s Guide: QwtSamplingThread Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Qwt User&#39;s Guide
   &#160;<span id="projectnumber">6.1.4</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('class_qwt_sampling_thread.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-slots">Public Slots</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="class_qwt_sampling_thread-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">QwtSamplingThread Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p>A thread collecting samples at regular intervals.  
 <a href="class_qwt_sampling_thread.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="qwt__sampling__thread_8h_source.html">qwt_sampling_thread.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for QwtSamplingThread:</div>
<div class="dyncontent">
<div class="center"><img src="class_qwt_sampling_thread__inherit__graph.png" border="0" usemap="#_qwt_sampling_thread_inherit__map" alt="Inheritance graph"/></div>
<map name="_qwt_sampling_thread_inherit__map" id="_qwt_sampling_thread_inherit__map">
</map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-slots"></a>
Public Slots</h2></td></tr>
<tr class="memitem:a36c56404ef0042cf52f1e592edf94f5d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_sampling_thread.html#a36c56404ef0042cf52f1e592edf94f5d">setInterval</a> (double <a class="el" href="class_qwt_sampling_thread.html#a4fd7b7df98159bb0daddab7709674991">interval</a>)</td></tr>
<tr class="separator:a36c56404ef0042cf52f1e592edf94f5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac644ff417342617a39dbd86e50d09132"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_sampling_thread.html#ac644ff417342617a39dbd86e50d09132">stop</a> ()</td></tr>
<tr class="separator:ac644ff417342617a39dbd86e50d09132"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7a0b4d5c172f2ded5f6b6483c6ab56e5"><td class="memItemLeft" align="right" valign="top"><a id="a7a0b4d5c172f2ded5f6b6483c6ab56e5"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_sampling_thread.html#a7a0b4d5c172f2ded5f6b6483c6ab56e5">~QwtSamplingThread</a> ()</td></tr>
<tr class="memdesc:a7a0b4d5c172f2ded5f6b6483c6ab56e5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:a7a0b4d5c172f2ded5f6b6483c6ab56e5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4fd7b7df98159bb0daddab7709674991"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_sampling_thread.html#a4fd7b7df98159bb0daddab7709674991">interval</a> () const</td></tr>
<tr class="separator:a4fd7b7df98159bb0daddab7709674991"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34514c4cd9b99228a150f002ac422771"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_sampling_thread.html#a34514c4cd9b99228a150f002ac422771">elapsed</a> () const</td></tr>
<tr class="separator:a34514c4cd9b99228a150f002ac422771"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:afb02e4696306d5211b4b6470410afbfc"><td class="memItemLeft" align="right" valign="top"><a id="afb02e4696306d5211b4b6470410afbfc"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_sampling_thread.html#afb02e4696306d5211b4b6470410afbfc">QwtSamplingThread</a> (QObject *parent=NULL)</td></tr>
<tr class="memdesc:afb02e4696306d5211b4b6470410afbfc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br /></td></tr>
<tr class="separator:afb02e4696306d5211b4b6470410afbfc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a247354fcc8e2597e105d87a2cfaa0a96"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_sampling_thread.html#a247354fcc8e2597e105d87a2cfaa0a96">run</a> ()</td></tr>
<tr class="separator:a247354fcc8e2597e105d87a2cfaa0a96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a67c4a524736808dc1ba3b81670c0cbd5"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_qwt_sampling_thread.html#a67c4a524736808dc1ba3b81670c0cbd5">sample</a> (double <a class="el" href="class_qwt_sampling_thread.html#a34514c4cd9b99228a150f002ac422771">elapsed</a>)=0</td></tr>
<tr class="separator:a67c4a524736808dc1ba3b81670c0cbd5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A thread collecting samples at regular intervals. </p>
<p>Continuous signals are converted into a discrete signal by collecting samples at regular intervals. A discrete signal can be displayed by a <a class="el" href="class_qwt_plot_series_item.html" title="Base class for plot items representing a series of samples. ">QwtPlotSeriesItem</a> on a <a class="el" href="class_qwt_plot.html" title="A 2-D plotting widget. ">QwtPlot</a> widget.</p>
<p><a class="el" href="class_qwt_sampling_thread.html" title="A thread collecting samples at regular intervals. ">QwtSamplingThread</a> starts a thread calling periodically <a class="el" href="class_qwt_sampling_thread.html#a67c4a524736808dc1ba3b81670c0cbd5">sample()</a>, to collect and store ( or emit ) a single sample.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_plot_curve.html" title="A plot item, that represents a series of points. ">QwtPlotCurve</a>, <a class="el" href="class_qwt_plot_series_item.html" title="Base class for plot items representing a series of samples. ">QwtPlotSeriesItem</a> </dd></dl>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a34514c4cd9b99228a150f002ac422771"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a34514c4cd9b99228a150f002ac422771">&#9670;&nbsp;</a></span>elapsed()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double QwtSamplingThread::elapsed </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>Time (in ms) since the thread was started </dd></dl>
<dl class="section see"><dt>See also</dt><dd>QThread::start(), <a class="el" href="class_qwt_sampling_thread.html#a247354fcc8e2597e105d87a2cfaa0a96">run()</a> </dd></dl>

</div>
</div>
<a id="a4fd7b7df98159bb0daddab7709674991"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4fd7b7df98159bb0daddab7709674991">&#9670;&nbsp;</a></span>interval()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double QwtSamplingThread::interval </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>Interval (in ms), between 2 calls of <a class="el" href="class_qwt_sampling_thread.html#a67c4a524736808dc1ba3b81670c0cbd5">sample()</a> </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_sampling_thread.html#a36c56404ef0042cf52f1e592edf94f5d">setInterval()</a> </dd></dl>

</div>
</div>
<a id="a247354fcc8e2597e105d87a2cfaa0a96"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a247354fcc8e2597e105d87a2cfaa0a96">&#9670;&nbsp;</a></span>run()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void QwtSamplingThread::run </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Loop collecting samples started from QThread::start() </p><dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_sampling_thread.html#ac644ff417342617a39dbd86e50d09132">stop()</a> </dd></dl>

</div>
</div>
<a id="a67c4a524736808dc1ba3b81670c0cbd5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a67c4a524736808dc1ba3b81670c0cbd5">&#9670;&nbsp;</a></span>sample()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void QwtSamplingThread::sample </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>elapsed</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Collect a sample</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">elapsed</td><td>Time since the thread was started in milliseconds </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a36c56404ef0042cf52f1e592edf94f5d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a36c56404ef0042cf52f1e592edf94f5d">&#9670;&nbsp;</a></span>setInterval</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void QwtSamplingThread::setInterval </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>interval</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">slot</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Change the interval (in ms), when <a class="el" href="class_qwt_sampling_thread.html#a67c4a524736808dc1ba3b81670c0cbd5">sample()</a> is called. The default interval is 1000.0 ( = 1s )</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">interval</td><td>Interval </td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_qwt_sampling_thread.html#a4fd7b7df98159bb0daddab7709674991">interval()</a> </dd></dl>

</div>
</div>
<a id="ac644ff417342617a39dbd86e50d09132"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac644ff417342617a39dbd86e50d09132">&#9670;&nbsp;</a></span>stop</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void QwtSamplingThread::stop </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">slot</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Terminate the collecting thread </p><dl class="section see"><dt>See also</dt><dd>QThread::start(), <a class="el" href="class_qwt_sampling_thread.html#a247354fcc8e2597e105d87a2cfaa0a96">run()</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_qwt_sampling_thread.html">QwtSamplingThread</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  </ul>
</div>
</body>
</html>
